#! /bin/sh

# The source server's URL.
SRCSERVER=file:///svnroot/migration-source
# The user name and password on source server.
SRCUSERNAME=
SRCPASSWORD=

# The destination's server's URL.
DESTSERVER=https://hexylutility.googlecode.com/svn/trunk/
# The user name and password on destination server.
DESTUSERNAME=Imhexyl
DESTPASSWORD=dq5MN2QJ6SJ9

if [ $# != 1 ]; then
    echo "Usage: ./svn-specversion-migration <specified version>"
    echo "Please enter the version need to migrate as the first paragram."
    exit 1
fi

svn co --username ${SRCUSERNAME} --password ${SRCPASSWORD} -r ${1} ${SRCSERVER} src
find ./src -name .svn -type d -exec rm -r -f {} \;

svn co --username ${DESTUSERNAME} --password ${DESTPASSWORD} ${DESTSERVER} dest
cp -r ./src/* ./dest/

svn add ./dest/*
svn commit ./dest -m "migratied from "${SRCSERVER}

rm -rf src
rm -rf dest
